<div id="publish" class="content-div publish-view" transition="fade">
  <div class="empty-div"></div>
	<div class="publish">
    <div class="header">
      <i class="icon MS-icon-pen"></i>
      <span>发布商品</span>
    </div>
    <div class="body">
      <div class="uploadPic">
        <div v-for="file in files" class="block">
          <img :src="file.data"/>
        </div>
        <span class="block uploadBlock"
          :class="uploadBlockFocus?'focus':''"
          @dragover.prevent="uploadBlockFocus=true"
          @dragleave.prevent="uploadBlockFocus=false"
          @drop.prevent.stop="drop" v-show="files.length<5">将图片拖到此处上传</span>
      </div>
      <div class="row">
        <span>商品名称</span>
        <input class="long"
          :class="{error:data.iName.length>25}"
          v-model="data.iName"
          type="text"
          placeholder="最多25个字"/>
      </div>
      <div class="row detail">
        <span>商品详情</span>
        <textarea class="long"
          :class="{error:data.des.length>200}"
          v-model="data.des"
          placeholder="建议填写物品用途、新旧程度、原价等信息，至少10个字"></textarea>
      </div>
      <div class="row">
        <span>交易地点</span>
        <input class="long"
          :class="{error:data.place.length>50}"
          v-model="data.place"
          type="text"
          placeholder="教学楼、宿舍楼、食堂等"/>
      </div>
      <div class="row">
        <span>价格</span>
        <input type="number"
          :class="{error:isNaN(data.price||0)}"
          v-model="data.price"
          placeholder="单位:元"/>
      </div>
      <div class="row">
        <span>分类</span>
        <select v-model="data.cid">
          <option v-for="opt in leftData.categorys" v-text="opt.cName" :value="opt.cid" :title="opt.des"></option>
        </select>
      </div>
      <div class="row">
        <span>讲价</span>
        <input type="button" :class="data.reduction?'select':''" @click="data.reduction=1" value="可商量"/>
        <input type="button" :class="data.reduction?'':'select'" @click="data.reduction=0" value="不二价"/>
      </div>
      <div class="row">
        <span>手机</span>
        <input type="tel"
          v-model="user.telphone"
          readonly="readonly"/>
      </div>
      <div class="row">
        <span>QQ</span>
        <input type="text"
          v-model="user.qq"
          readonly="readonly"/>
      </div>
      <div class="publish-btn" @click="submit">马上发布</div>
    </div>
  </div>
</div>